{% extends "main.html" %}
{% block search %}
<div id="searchdiv" class="searchdiv">
      <form action="/search" method="get">
      <input autocomplete="off" name="q" id="q" type="text" tabindex="1" value="{{query}}"/>
     

      <script type="text/javascript" src="/static/slideshow/scripts.js"></script>
      
      <script type="text/javascript">
          function showTopics(){
             document.getElementById('topics').style.visibility='visible';
            document.getElementById('random-topics').style.display='none';
        }
          $(document).ready(function() {     
        $("#q").autocomplete(
            [             {%for keyw in allkeywords%}
                    "{{keyw}}",
             {%endfor%}''],
            {
                delay:1,
                minChars:1,
                matchSubset:1,
                autoFill:true,
                maxItemsToShow:10,
                multiple:true,
                multipleSeparator: " " 
            }
        );
    });

    

      
      </script>
      <input type="submit" value="Search" />
      </form>
      <span class="hottopics">
        <span id="random-topics" class="keywords">
        Hot topics: 
            {%for keyw in hotkeywords|slice:"3"%}
                    <a href="?q={{keyw}}">{{keyw}}</a>
             {%endfor%}
             <a href="/" onclick="showTopics();">more...</a>
             <br>
             
        </span>
        <!--
        <span id="topics" style="visibility:hidden" class="keywords">
             {%for keyw in hotkeywords|slice:"20"%}
                    <a href="?q={{keyw}}">{{keyw}}</a>
             {%endfor%}
        </span>-->
       </span>
    </div>
{% endblock %}


{% block user %}
<span class="menulinks">
	     {{utext}}
	     <br>	     
	       {% if user %}
	       {% if admin %}
	       		<a href="/admin">Admin</a>
	       	{% endif %}
	     	<a href="?commented=true"><img title="Commented articles" style="height:15px;width:15px" src="/static/icommented50.png" ></img>My Comments</a>
	     	<a href="?starred=true"><img title="Favourite articles" style="height:15px;width:15px" src="/static/full-star.gif" ></img>Favorites</a>
	     	{% ifequal language "english" %}	     	
	     		<a href="?language=spanish"><img title="Language" style="height:15px;width:15px" src="/static/globe2_small.png" ></img>Espanol</a>    	
	     	{% else%}
	     		<a href="?language=english"><img title="Language" style="height:15px;width:15px" src="/static/globe2_small.png" ></img>English</a>	
	     	{% endifequal %}
	     {% endif %}
 	  </span>
{% endblock %}


{% block content %}

	
<div class="content">
    {%if not user %}
<br>	
<div id="firsttime">
	<!-- adding switching pics-->
  <div id="header"><div class="wrap">
   <div id="slide-holder">
<div id="slide-runner">
    <a href=""><img id="slide-img-1" src="static/slideshow/opening.jpg" class="slide" alt="" /></a>
    <a href=""><img id="slide-img-2" src="static/slideshow/anti-israel.jpg" class="slide" alt="" /></a>
    <a href=""><img id="slide-img-3" src="static/slideshow/articles.jpg" class="slide" alt="" /></a>
    <a href=""><img id="slide-img-4" src="static/slideshow/4.jpg" class="slide" alt="" /></a>
    <a href=""><img id="slide-img-5" src="static/slideshow/icommented.jpg" class="slide" alt="" /></a>
    <a href=""><img id="slide-img-6" src="static/slideshow/opening.jpg" class="slide" alt="" /></a> 
    <div id="slide-controls">
     <!--p id="slide-client" class="text"><strong>post: </strong><span></span></p-->
     <p id="slide-desc" class="text"></p>
     <p id="slide-nav"></p>
    </div>

</div>
	
	<!--content featured gallery here -->
   </div>
   <script type="text/javascript">
    if(!window.slider) var slider={};slider.data=
	[{"id":"slide-img-1","client":"ilikeil","desc":"Welcome to ilike-IL, a site that helps you comment for Israel"},
	{"id":"slide-img-2","client":"ilikeil","desc":"We are facing a new kind of war these days - it takes place on the Internet, where Israel is on the spot"},
	{"id":"slide-img-3","client":"ilikeil","desc":"How can I help? 1) Login and find an interesting news story"},
	{"id":"slide-img-4","client":"ilikeil","desc":"2) Comment using our tips"},
	{"id":"slide-img-5","client":"ilikeil","desc":"3) Click I commented to notify you've helped, and share with your friends"},
	{"id":"slide-img-6","client":"ilikeil","desc":"Thank you!"}];	
   </script>
  </div></div>
  <!--/header-->
    <a href="#" onclick="javascript:getElementById('firsttime').innerHTML='';void(0)">Close[X]</a></br>
    </div>
    {% else %}
    <div id="recenttips">
{% if rank %}
                    
                        {{rank}} users commented more than you. Come on, You can do better!
                        {% else %}
                        <br/>
                        You are the top commenter in iLike-IL. Keep up the good work!
                    {% endif %}
					<br/>    <br/>
	<h3>Recent Tips</h3>
	{% for tip in tips|slice:"7" %}
        <span>

<a target="_blank" href="{{tip.url}}" title="{{tip.title}}" >
                 
        <img
		{% if tip.pic_url %}
		src="{{tip.pic_url}}" 
		{% else %}
		src="/static/logo80.jpg" 
		{% endif %}
        
		class="thumb" alt="" />        

		</a>
</span>
    {% endfor %}
    <br/>
        <a href="#" onclick="javascript:getElementById('recenttips').innerHTML='';void(0)">Close[X]</a>
    <br/>
    </div>
        {% endif %}
    <div>
    <br/>
	                    	        	
	<h3>News Stories / <a href="?YouTube=True"><img title="YouTube posts" style="vertical-align:bottom" src="/static/btn_footer_youtube_off.png" ></img></a></h3>
    {% for article in articles %}

    
	<div class="articlebox">
        <a href="article?key={{article.key}}{%if user_min%}&min=m{%endif%}" title="{{article.title}}" style="float: left; ">
                 
        <img
		{% if article.pic_url %}
		src="{{article.pic_url}}" 
		{% else %}
		src="/static/logo80.jpg" 
		{% endif %}
        
		class="thumb" alt="" />        

		</a>
        <div class="articlebox-text">            
            {% if article.latest_activity.commented %}
            <img title="I commented on this article" style="height:15px;width:15px" src="/static/icommented50.png" ></img>
            {% endif %}
            {% if article.latest_activity.starred %}
            <img title="Favourite article" style="height:15px;width:15px" src="/static/full-star.gif" ></img>
            {% endif %}            
            {% if article.latest_activity.inc %}
            <img title="Marked relevant" style="height:15px;width:15px" src="/static/like.gif" ></img>
            {% endif %}
            {% if article.latest_activity.dec %}
            <img title="Marked relevant" style="height:15px;width:15px" src="/static/dislike.gif" ></img>
            {% endif %}
            <b style="margin-bottom: 5px; height: 30px;">
			<a href="article?key={{article.key}}{%if user_min%}&min=m{%endif%}">
            {{article.title}}</a></b>
            <div>{{article.desc|truncatewords:"30"}}</div>
            <span class="source">by {{article.source}} | {{article.pretty_date}} | <b>views:{{article.usersViewed}}</b> | 
            {% ifequal article.usersCommented 0 %}
            <a style="color:gray" href="article?key={{article.key}}{%if user_min%}&min=m{%endif%}">Be the first to comment!</a>
            {% else %}
              comments:{{article.usersCommented}}
            {% endifequal %}
             </span>
        </div>
    </div>
    {% endfor %}

{% endblock %}



{% block bottom %}
<br>
<table class="paginator" width="95%" align="center" cellpadding="3" cellspacing="0" style="margin-bottom:5">
  <tbody><tr><td>

        {% if prev_url %}
            <a href="{{prev_url}}" ><div class="prevbutton"></div>Previous</a>
        {% endif %}
		</td><td width="900px"></td><td>  
        {% if hasnextpage %}
            <a href="{{next_url}}" ><div class="nextbutton"></div>Next</a>
        {% endif %}  
        
    </td></tr></tbody></table>
<!-- <center><h2>Help us by <a href="addarticle">suggesting an article for iLike-IL</a></h2></center>  -->
    <table width="95%" align="center" cellpadding="3" cellspacing="0" bgcolor="#C3D9FF" style="margin-bottom:5">
  <tbody><tr>
  <td class="bubble tl" align="left" valign="top"><div class="SPRITE_corner_tl"></div></td>
  <td class="bubble" rowspan="2" style="text-align:left">
  <div align="center">
  <font size="-1" color="#666666">TAU Google Technologies for Cloud Development Workshop 2010
  {% if admin %}
  <a href="admin">Admin</a> -
  {% endif %}
  <a href="about">About</a> -
  <a href="http://code.google.com/p/ilikeil/">Development</a> -
  <a href="support">Support</a>
  
  </font>
  </div>
  </td>
  <td class="bubble tr" align="right" valign="top"><div class="SPRITE_corner_tr"></div></td>
  </tr>
  <tr>
  <td class="bubble bl" align="left" valign="bottom"><div class="SPRITE_corner_bl"></div></td>
  <td class="bubble br" align="right" valign="bottom"><div class="SPRITE_corner_br"></div></td>
  </tr>
</tbody></table>
    <script type="text/javascript">
  var rpxJsHost = (("https:" == document.location.protocol) ? "https://" : "http://static.");
  document.write(unescape("%3Cscript src='" + rpxJsHost +
"rpxnow.com/js/lib/rpx.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
  RPXNOW.overlay = true;
  RPXNOW.language_preference = 'en';
</script>
{% endblock %}
</div>